package ua.com.fesvlast.hotel.tests.dao;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import ua.com.fesvlast.hotel.model.dao.DAOFactory;
import ua.com.fesvlast.hotel.model.enteties.Bills;
import ua.com.fesvlast.hotel.model.utils.DateFormatter;
import ua.com.fesvlast.hotel.model.utils.OrderStatus;

public class BiilDaoTest {
	Bills bill;
	
	@Before
	public void init(){
		bill =new Bills();
		bill.setDiscount(0);
		bill.setMessage("Message");
		bill.setOrderId(2);
		bill.setOrderStatus(OrderStatus.OPENED.toString());
		bill.setSendDate(DateFormatter.getCurrentFormatDate());
		bill.setTotalPrice(45);
	}
	
	@Ignore
	@Test
	public void createBill(){
		assertEquals("Check the BillDAO to assert date ",true, DAOFactory.getBillsDAO().createBill(bill));
	}
	
	@Test
	public void getListBills(){
		int idBill=3;
		List<Bills> list =DAOFactory.getBillsDAO().getListBills(OrderStatus.OPENED);
		assertEquals("Not return empty list",idBill, list.get(0).getBillId() );
	}
}
